<template>
  <!-- <nav-bar title="首页" /> -->
  <div class="page-main">
    <div class="main-suv">
      <tabs-box :data="tabs" :replace="true" :shrink="false" :defaultActive="$route.meta.active"></tabs-box>
      <router-view v-slot="{ Component }">
          <keep-alive v-if="$route.meta.keepAlive">
            <component :is="Component" :key="$route.fullPath" />
          </keep-alive>
          <component v-else :is="Component" :key="$route.fullPath" />
      </router-view>
    </div>
  </div>
  <tab-bar :defaultActive="0" />
</template>
<script setup name="home">
import { ref } from "vue"
const tabs = ref(
[
	{
		name: "加载列表",
		badge: 0,
		to: {
			path: '/home/loading'
		}
	},
	{
		name: "任务列表",
		badge: 0,
		to: {
			path: '/home/task'
		}
	},
	{
		name: "游戏",
		badge: 0,
		to: {
			path: '/home/box'
		}
	}
])
onMounted(() => {
  console.log("home-mounted")
})
</script>
